﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using RbacLib.Entities;

namespace RbacLib.Mappers
{
	public class PermissionMap : ClassMap<Permission>
    {
		public PermissionMap()
		{
			Id(x => x.Id);
							
													Map(x => x.CreateDate)												;			
					
													Map(x => x.UpdateDate)												;			
					
													Map(x => x.UpdateBy)												;			
					
													Map(x => x.Version)												;			
					
													Map(x => x.PermissionName).Not.Nullable()						.Length(100)						;			
					
													Map(x => x.Description).Not.Nullable()						.Length(255)						;			
					
													References(x => x.Function).Cascade.All();
					
													Map(x => x.ProjectId).Not.Nullable()												;			
					
													References(x => x.Role).Cascade.All();
					
													Map(x => x.IsActive).Not.Nullable()												;			
					
					}

	}
}